/**
 * chenxitech.cn Inc.
 * Copyright (c) 2017-2017 All Rights Reserved.
 */
package tbdp.tool;

import org.apache.hadoop.hbase.client.HTableInterface;

import tbdp.tool.hbase.HBaseConnection;
import tbdp.tool.hbase.HBaseConnectionFactory;
import tbdp.tool.hbase.HbaseConnector;

/**
 * @author xbkaishui
 * @version $Id: Utils.java, v 0.1 2017-06-07 下午10:10 xbkaishui Exp $$
 */
public class Utils {

    public static HTableInterface getHbaseTable(String table) {
        String zkNode = System.getProperty("hbase_znode", Constants.HBASE_ZNODE);
        String zkAddr = System.getProperty("hbase_zk", Constants.HBASE_ZK);
        HBaseConnection conn = new HBaseConnection(zkAddr, zkNode);
        HbaseConnector hbaseConnector = HBaseConnectionFactory.instance().getHbaseConnector(conn);
        System.out.println(("hbase table " + table));
        return hbaseConnector.getTable(table);
    }
}
